Skip to content

Add a G4 parameter to transport e-, e+ and gamma with G4HepEm - #16155

Open
sawenzel wants to merge 4 commits into
AliceO2Group:devfrom
sawenzel:g4hepem-pr
Open

sawenzel wants to merge 4 commits into
AliceO2Group:devfrom
sawenzel:g4hepem-pr

Conversation

@sawenzel

@sawenzel sawenzel commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

This adds the switch G4.useG4HepEm, off by default. With it, e-, e+ and gamma are transported with G4HepEm instead of the Geant4 standard EM physics:

o2-sim -e TGeant4 --configKeyValues "G4.useG4HepEm=1" ...

The switch appends _HEP to the hadronic physics list, eg. FTFP_BERT_EMV_HEP+optical, which selects G4HepEm in geant4_vmc. It needs a geant4_vmc built with G4HepEm, which comes with vmc-project/geant4_vmc#93 and alisw/alidist#6428. By default, nothing changes for the user.

In addition:

  • The EMCAL Geant4 sampling factor for the new list is explicit: 0.808, which gives the same energy per primary as FTFP_BERT_EMV+optical with 0.821 (O2-7210).
  • TRD takes its charge from the collision tables of TRD ionisation model independent of the Geant4 energy loss #16128 when G4HepEm is active, since G4HepEm has no PAI model; the new default TRDSimParams.ionisationModel=-1 does this, and an explicit value still wins.
  • FindGeant4.cmake returns early when its targets already exist, because a geant4_vmc built with G4HepEm makes CMake look for Geant4 a second time.

The validation (GRID productions of pp events, K0S and photon candles, EMCAL and PHOS response) is summarised in https://its.cern.ch/jira/browse/O2-7316: tracking, vertexing, K0S and photon conversions agree within 0.1-0.5 %, and transport is about 5 % faster for pp. The TPC fix found during this work is #16131.

Relates to https://its.cern.ch/jira/browse/O2-5901
and https://its.cern.ch/jira/browse/O2-7316

Assisted by Claude Code.

sawenzel and others added 4 commits November 18, 2026 19:26
This adds the switch G4.useG4HepEm, off by default.

- It appends _HEP to the hadronic physics list, eg. FTFP_BERT_EMV_HEP+optical,
  which selects G4HepEm in geant4_vmc.
- It needs a geant4_vmc built with G4HepEm.

https://its.cern.ch/jira/browse/O2-5901
https://its.cern.ch/jira/browse/O2-7316

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This lets FindGeant4 return early when its targets already exist.

- A geant4_vmc built with G4HepEm finds G4HepEm, which finds Geant4 again.
- FindGeant4 then failed because the geant4 target already existed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This makes the Geant4 sampling factor for FTFP_BERT_EMV_HEP+optical explicit.

- The value 0.808 gives the same EMCAL energy per primary as FTFP_BERT_EMV+optical with 0.821.
- It was determined with e- of 1 to 20 GeV and gamma of 1 to 5 GeV; the agreement is within 1 % at all energies.
- Before, the list fell back to the default 0.81 by name.

https://its.cern.ch/jira/browse/O2-7210
https://its.cern.ch/jira/browse/O2-7316

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This makes the TRD ionisation model follow the G4HepEm physics.

- The new default TRDSimParams.ionisationModel=-1 selects the collision tables (1) when G4HepEm transports e-, e+ and gamma, and the energy deposit with PAI (0) otherwise.
- G4HepEm counts as active when the physics list in use has the suffix _HEP, so a list given by name behaves like G4.useG4HepEm=1.
- An explicit 0 or 1 still wins; 0 together with G4HepEm gives a warning, since G4HepEm has no PAI model.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant